#include "viewpanel.h"
#include "ui_viewpanel.h"
#include "glpanel.h"
#include <qlayout.h>

ViewPanel::ViewPanel(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::ViewPanel),
    c( NULL )
{
    ui->setupUi(this);

    // Create our OpenGL widget
    c = new GLPanel( ui->frame, "glbox");
    // Put the GL widget inside the frame
    QHBoxLayout* flayout = new QHBoxLayout( ui->frame );
    flayout->addWidget( c, 1 );

    // Top level layout, puts the sliders to the left of the frame/GL widget
    //QHBoxLayout* hlayout = new QHBoxLayout( this);
    //hlayout->addWidget( ui->frame, 1 );
}

ViewPanel::~ViewPanel()
{
    delete ui;
}

void ViewPanel::viewMesh( Mesh* _mesh )
{
  c->viewMesh( _mesh );
  c->update();
}

void ViewPanel::viewMesh_vp( map<int,vector<double> > n, map<int,vector<int> > e, double valormax , double valormin, map<int ,double > m, vector<vector<double> > p)
{
    //c->viewMesh(n,e, valormax, valormin, m, p);
    //c->initializeGL();
    //c->update();
}
